package com.example.androidkt.fourth

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import com.example.androidkt.R

class Lifecycle1Activity : AppCompatActivity() {

    private val lifecycleObject = LifecycleObject()
    private val lifecOB1 = LifecycleObject1(this)

    val TAG =this.javaClass.simpleName
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_lifecycle1)

        lifecycleObject.onCreate()
//        LifecycleObject()
//        LifecycleObject1(this)
        LifecycleObject3(this)
    }

    override fun onResume() {
        super.onResume()
        lifecycleObject.onResume()
        Log.d(TAG,"Lifecycle1Activity  ->    onResume")
    }

    override fun onPause() {
        super.onPause()
        lifecycleObject.onPause()
        Log.d(TAG,"Lifecycle1Activity  ->    onPause")
    }

    override fun onDestroy() {
        super.onDestroy()
        lifecycleObject.onDestory()
        Log.d(TAG,"Lifecycle1Activity  ->    onDestroy")
    }
}